package site.wetsion.employ.server.mapper;

import java.math.BigInteger;
import java.util.List;

import org.apache.ibatis.annotations.Param;

import site.wetsion.employ.server.pojo.EnterpriseUser;
import site.wetsion.employ.server.pojo.User;

public interface UserMapper {

	//根据用户id查询用户信息
	public User findUserById(BigInteger id) throws Exception;
	/** 根据id查询发布人名称*/
	public String getCreaterNameById(BigInteger id) throws Exception;
		
	//根据用户名称  查询用户信息
	public List<User> findUserByName(
			@Param("username") String username,
			@Param("page") int pageNum,
			@Param("pageSize") int pageSize) throws Exception;
	public int findCountOfUserByName(
			String username) throws Exception;
	
	//根据用户名称  查询用户信息
	public User findUserByEmail(String email) throws Exception;
	
	//根据用户id查询用户的角色id
	public int findRoleByUserId(BigInteger id) throws Exception;
		
	//插入用户
	public void insertUser(User user)throws Exception;
	
	//删除用户
	public void deleteUser(int id) throws Exception;
	
	//修改用户
	public void updateUser(User user) throws Exception;
	
	/** 根据用户id查询企业用户表*/
	public EnterpriseUser getEnterpriseUserByUid(BigInteger userId) throws Exception;
	
	public void insertEnterpriseUser(EnterpriseUser enterpriseUser) throws Exception;
	
	/** 根据id查询企业用户表*/
	public EnterpriseUser getEnterpriseUserByid(BigInteger id) throws Exception;
	
	public void updateEnterpriseUserStatus(
			@Param("id") BigInteger id,
			@Param("status") Integer status) throws Exception;
	
	
	public List<EnterpriseUser> getUncheckEnterpriseUserList(
			@Param("page") int page, 
			@Param("pageSize") int pageSize) throws Exception;
	
	public int getUncheckEnterpriseUserCount() throws Exception;
	
	public void insertUserRole(
			@Param("userId") BigInteger userId, 
			@Param("roleId") int roleId) throws Exception;
	
}
